package leetcode.weekly.week308;

//Solution2Test
public class Solution2 {

	public String removeStars(String s) {
		char[] cs = s.toCharArray();
		StringBuffer ans = new StringBuffer();
		for (int i = 0; i < s.length(); i++) {
			char c = cs[i];
			if (c != '*') {
				ans.append(c);
			} else {
				ans.deleteCharAt(ans.length() - 1);
			}
		}
		return ans.toString();
	}
}
